//
//  StatusTransmitCell.swift
//  WeiBoSwift
//
//  Created by rong on 15/7/3.
//  Copyright © 2015年 rong. All rights reserved.
//

import UIKit
import FFAutoLayout


class StatusTransmitCell: StatusCell {

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        transmitLabel = UILabel(color: UIColor.darkGrayColor(), fontSize: 14, multiLines: true)
        transmitLabel!.preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.width - 16
        
        insertSubview(transmitLabel!, atIndex: 0)
        
        
        transmitBtn.backgroundColor = UIColor(white: 0.9, alpha: 1.0)
        insertSubview(transmitBtn, atIndex: 0)
        
        //自动布局
        transmitBtn.ff_AlignVertical(ff_AlignType.BottomLeft, referView: contentLabel, size: nil, offset:CGPoint(x:-12, y:12))
        transmitBtn.ff_AlignVertical(ff_AlignType.TopRight, referView: footorView, size: nil)
        
        transmitLabel!.ff_AlignInner(ff_AlignType.TopLeft, referView: transmitBtn, size: nil, offset: CGPoint(x:12, y:12))
        
        //配图视图
//        let picCons = pictureView.ff_AlignVertical(ff_AlignType.BottomLeft, referView: transmitLabel!, size: CGSizeMake(290, 90), offset: CGPoint(x: 0, y: 12))
//        
//        picWithCons = pictureView.ff_Constraint(picCons, attribute: NSLayoutAttribute.Width)
//        picHeigtCons = pictureView.ff_Constraint(picCons, attribute: NSLayoutAttribute.Height)
//        topCons = pictureView.ff_Constraint(picCons, attribute: NSLayoutAttribute.Top)
        
        recordPictureViewCons(pictureView.ff_AlignVertical(ff_AlignType.BottomLeft, referView: transmitLabel!, size: CGSizeMake(290, 90), offset: CGPoint(x: 0, y: 12)))

    }

    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    
    //懒加载控件
    lazy var transmitBtn = UIButton()
   // lazy var transmitLabel = UILabel(color: UIColor(white: 0.5, alpha: 1.0), fontSize: 14.0, multiLines: true)
}
